const mysql = require("mysql");
const clinet = mysql.createConnection({
    host: "localhost",
    user: "root",
    password: "123456", // 123456
    database: "web2020", // web2020
})

function sqlFn(sql, arr, callback) {
    // 执行数据库语句的方法
    clinet.query(sql, arr, (error, result) => {
        if (error) {
            console.log(error)
            return;
        }
        callback(result)
    })
}


module.exports = sqlFn